1. Field of the Invention
The present invention relates to an image processing device, an image processing method and an image processing program product, and particularly to an image processing device, an image processing method and an image processing program product, which perform inclination correcting processing on an input image data.
2. Description of the Background Art
In addition to image data obtained by scanners, image data read by facsimile machines are now handled on computers in some cases, and such cases are increasing.
Image data, which is obtained from the facsimile machine in a certain operation mode, may have a longitudinal resolution different from a lateral resolution. For example, a facsimile machine in a super-fine mode provides an image having longitudinal and lateral resolutions of 200 dpi×400 dpi.
In many cases, the image obtained by the scanner has longitudinal and lateral resolutions equal to each other. In some types of scanners, longitudinal and lateral read resolutions can be set independently of each other.
Various methods have been proposed for performing inclination correcting processing of correcting an inclination of read image data. For example, Japanese Patent Laying-Open No. 57-69372 has disclosed an inclination correcting device, in which a cumulative histogram is prepared for each of lines of the read image in various scanning directions, and an inclination angle is detected by utilizing properties that a distinct peak occurs in the cumulative histogram when the scanning direction and the inclination angle match with each other. The inclination correcting device corrects the inclination by rotating the read image based on the inclination angle thus detected.
Japanese Patent Laying-Open No. 8-23439 has also disclosed a facsimile machine, which corrects an inclination of a read image by detecting an inclination angle in a similar manner.
Japanese Patent Laying-Open No. 2001-320554 has disclosed a facsimile machine, which detects rules defining rectangular regions from read image data, detects the inclination angle by detecting an angular shift of the rules and thereby corrects the inclination.
The inclination correcting processing disclosed in Japanese Patent Laying-Open No. 57-69372 and others is predicated on that the read image has the longitudinal and lateral resolutions equal to each other, and thus the inclination angle of the lateral direction of the read image is equal to the inclination angle of the longitudinal direction. For example, if the read image is inclined by an angle as shown in FIG. 22, the inclinations of the longitudinal and lateral directions can be simultaneously corrected by rotating clockwise the image by an angle θ.
However, if the longitudinal resolution of the read image is equal to half the lateral resolution thereof as shown in FIG. 23, the inclination angle (θ−α) of the lateral direction is different from the inclination angle (θ+β) of the longitudinal direction. Even when the foregoing inclination correcting processing is effected on this image, and thus, even when the image is rotated by an angle of (θ−α) to correct the inclination of the lateral direction, the inclination of the longitudinal direction is still left at an angle of ((θ+β)−(θ−α))=(α+β). A similar problem occurs when the image is rotated to correct the inclination of the longitudinal direction.
A specific example, in which the foregoing processing is applied to a practical image, will now be described with reference to the drawings. FIG. 24 shows a practical example of an inclined image, of which longitudinal resolution is different from the lateral resolution. More specifically, the image shown in FIG. 24 is read by a facsimile machine, has resolutions of 200 dpi×400 dpi and is inclined. FIG. 25 shows a specific example of an image, which is produced by effecting the foregoing inclination correcting processing on the above inclined image having the longitudinal and lateral resolutions different from each other. Referring to FIG. 25, when the foregoing inclination correcting processing is effected on the inclined image in FIG. 24 having the longitudinal and lateral resolutions different from each other, the inclination of the lateral direction is eliminated. However, the inclination of the longitudinal direction is not eliminated.
In the above case, the corrected image shown in FIG. 25 may be further shifted laterally by a slight extent on a row-by-row basis or block-by-block basis so that the inclination of the longitudinal direction can be corrected. In this manner, however, the inclined characters and lines are merely shifted laterally. Therefore, an image quality is impaired.